package com.xuecheng.base.exception;

/**
 * @Author: 40斤
 * @CreateTime: 2024-07-28  22:21
 * @Description: 自定义异常
 * @Version: 1.0
 */
public class XueChengPlusException extends RuntimeException{

    private String errMessage;

    public XueChengPlusException(String errMessage) {
        this.errMessage = errMessage;
    }

    public XueChengPlusException(String message, String errMessage) {
        super(message);
        this.errMessage = errMessage;
    }

    public String getErrMessage() {
        return errMessage;
    }

    public void setErrMessage(String errMessage) {
        this.errMessage = errMessage;
    }

    public static void cast(CommonError commonError){
        throw new XueChengPlusException(commonError.getErrMessage());
    }
    public static void cast(String errMessage){
        throw new XueChengPlusException(errMessage);
    }
}